package com.upf1sh.controller.SJZ;

import com.upf1sh.bean.SJZ.SJZ;
import com.upf1sh.service.SJZ.SJZService;
import com.upf1sh.service.ThingsboardTelemetryService;
import com.upf1sh.utils.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/SJZ")
public class SJZController {
    @Resource
    private SJZService sjzService;
    @Resource
    private ThingsboardTelemetryService telemetryService;

    @RequestMapping("/getAllData")
    public Result getAllData() {
        return Result.ok().data("data", sjzService.getAllData());
    }


    @RequestMapping("/insert")
    public boolean insert(SJZ sjz) {
        return sjzService.insertData(sjz) == 1 ? true : false;
    }
}
